import statusCode from "@/commons/statusCode"
import axios from "axios"

export default {
    login(data) {
        return axios.post("/user/login", data,{params:{code:data.code}})
    },
    register(data) {
        return axios.post("/user/register", data)
    },
    getUserInfo() {
        return axios.post("/user/getUserInfo")
    },
    save(data) {
        return axios.post('/user/save', data)
    },
    logout() {
        return axios.post('/user/logout')
    },
    getUser(id) {
        return axios.post(`/user/${id}`)
    },
    follow(id) {
        return axios.post(`/userFollowing/follow/${id}`)
    },
    unfollow(id) {
        return axios.delete(`/userFollowing/follow/${id}`)
    },
    getFansList(data) {
        return axios.post('/userFollowing/getFans',null,{
            params:data
        })
    },
    getFollowingList(data) {
        return axios.post('/userFollowing/getFollowingUser',null,{params:data})
    },
    search(data) {
        return axios({
            method:"POST",
            params:data,
            url:"/user/search"
        })
    }
}